<!DOCTYPE html>
<html>
{% load static %}
<head>
	<meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" >
	<title>{% block title %}{% endblock %}</title>
	<link rel="stylesheet" type="text/css" href="{% static '/css/reset.css' %}">
	<link rel="stylesheet" type="text/css" href="{% static '/css/animate.css' %}">
	<link rel="stylesheet" type="text/css" href="{% static '/css/style.css' %}">
    {% block customCss %}{% endblock %}
    <script src="{% static '/js/jquery.min.js' %}" type="text/javascript"></script>
    <script src="{% static '/js/jquery-migrate-1.2.1.min.js' %}" type="text/javascript"></script>
    <script src="{% static '/js/selectUi.js' %}" type='text/javascript'></script>
    <script src="{% static '/js/deco-common.js' %}" type='text/javascript'></script>
    <script src="{% static '/js/plugins/laydate/laydate.js' %}" type="text/javascript"></script>
    <script src="{% static '/js/plugins/layer/layer.js' %}"></script>
    <script src="{% static '/js/plugins/queryCity/js/public.js' %}" type="text/javascript"></script>
    <script src="{% static '/js/unslider.js' %}" type="text/javascript"></script>
    <script src="{% static '/js/plugins/jquery.scrollLoading.js' %}"  type="text/javascript"></script>
    <script src="{% static '/js/deco-common.js' %}"  type="text/javascript"></script>
    {% block customJs %}{% endblock %}
    <script>
    $(function(){
        $('#jsSearchBtn').on('click',function() {
            search_click()
        })
    })
    //顶部搜索栏搜索方法
    function search_click() {
        var type = $('#jsSelectOption').attr('data-value')
        var keywords = $('#search_keywords').val()
        var request_url = ''
        if(keywords == ""){
            return
        }
        if(type == "courses"){
             request_url = "/courses/coursePage?keywords="+keywords
        }else if(type == "teachers"){
             request_url = "/orgs/teacherPage?keywords="+keywords
        }else if(type == "orgs"){
             request_url = "/orgs/orgPage?keywords="+keywords
        }
        window.location.href = request_url
    }
    </script>
</head>
<body>
<!-- 头部信息 -->
<section class="headerwrap ">
<header>
    <div  class=" header">
        {% if request.user.is_authenticated %}
        <div class="top">
            <div class="wp">
                <div class="fl"><p>服务电话：<b>848045826</b></p></div>
                <div class="personal">
                        <dl class="user fr">
                            <dd>
{% if request.user.nickName  %}{{ request.user.nickName }}{% else %}{{ request.user.email }}{% endif %}
                                <img class="down fr" src="{% static '/images/top_down.png' %}"/>
                            </dd>
                            <dt>
                                <img width="20" height="20" src="{{ MEDIA_URL }}{{ request.user.image }}"/>
                            </dt>
                        </dl>
                        <div class="userdetail">
                            <dl>
                                <dt>
                                    <img width="80" height="80" src="{{ MEDIA_URL }}{{ request.user.image }}"/>
                                </dt>
                                <dd>
                                    <h2>django</h2>
                                    <p>{{ request.user.username }}</p>
                                </dd>
                            </dl>
                            <div class="btn">
                                <a class="personcenter fl" href="{% url 'users:userCenterInfo' %}">进入个人中心</a>
                                <a class="fr" href="{% url 'users:logout' %}">退出</a>
                            </div>
                        </div>
                    </div>
                <a href="usercenter-message.html">
                        <div class="msg-num">
                            <span id="MsgNum">{{ request.user.getUnReadMessages }}</span>
                        </div>
                    </a>
                </div>
        </div>
        {% else %}
        <div class="top">
            <div class="wp">
                <div class="fl"><p>服务电话：<b>848245826</b></p></div>
                <a style="color:white" class="fr registerbtn" href="{% url "users:register" %}">注册</a>
                <a style="color:white" class="fr loginbtn" href="{% url "users:login" %}">登录</a>
            </div>
        </div>
        {% endif %}
        <div class="middle">
            <div class="wp">
                <a href="{% url 'index' %}">
                    <img class="fl" src="{% static '/images/logo.jpg' %}"/>
                </a>
                <div class="searchbox fr">
                    <div class="selectContainer fl">
                        <span class="selectOption" id="jsSelectOption" data-value="courses">
                            公开课
                        </span>
                        <ul class="selectMenu" id="jsSelectMenu">
                            <li data-value="courses">公开课</li>
                            <li data-value="orgs">课程机构</li>
                            <li data-value="teachers">授课老师</li>
                        </ul>
                    </div>
                    <input id="search_keywords" class="fl" type="text" value="" placeholder="请输入搜索内容"/>
                    <img class="search_btn fr" id="jsSearchBtn" src="{% static '/images/search_btn.png' %}"/>
                </div>
            </div>
        </div>
        <nav>
            <div class="nav">
                <div class="wp">
                    <ul>
                        <li {% ifequal request.path "/" %}class="active"{% endifequal %}>
                            <a href="{% url 'index' %}">首页</a>
                        </li>
                        <li {% ifequal request.path|slice:"15" "/courses/course" %}class="active"{% endifequal %}>
                            <a href="{% url 'courses:coursePage' %}">
                                公开课<img class="hot" src="{% static '/images/nav_hot.png' %}">
                            </a>
                        </li>
                        <li {% ifequal request.path|slice:"13" "/orgs/teacher" %}class="active"{% endifequal %}>
                            <a href="{% url 'orgs:teacherPage' %}">授课教师</a>
                        </li>
                        <li {% ifequal request.path|slice:"9" "/orgs/org" %}class="active"{% endifequal %}>
                            <a href="{% url 'orgs:orgPage' %}">授课机构</a>
                        </li>
                    </ul>
                </div>
            </div>
        </nav>
        </div>
</header>
</section>

<!--面包屑-->
{% block customBread %}
<section>
    <div class="wp">
        <ul  class="crumbs">
            <li>
                <a href="{% url 'index' %}">首页</a>>
            </li>
            <li>课程机构</li>
        </ul>
    </div>
</section>
{% endblock %}

<!-- 模板主题内容 -->
{% block content %}{% endblock %}

<!-- 底部信息 -->
<footer>
    <div class="footer">
        <div class="wp">
            <ul class="cont">
                <li class="logo">
                    <a href="">
                        <img src="{% static '/images/footlogo.png' %}"/>
                    </a>
                </li>
                <li class="code">
                    <img src="{% static '/images/code.jpg' %}"/>
                    <p class="center">扫描关注微信</p>
                </li>
                <li class="third">
                    <img class="fl" src="{% static '/images/tell.png' %}"/>
                    <p class="tell">848045826</p>
                    <p class="time">周一至周日 9:00-18:00</p>
                </li>
            </ul>
        </div>
        <p class="line"></p>
        <div class="wp clear">
            <span class="fl">2016 www.projectsedu.com 慕学在线-在线学习交流平台 保留所有权利</span>
            <span class="fr">copyright 2016 ICP备案证书号：蜀ICP备xxxxx号-1</span>
        </div>
    </div>
</footer>

<section>
    <ul class="sidebar">
        <li class="qq">
            <a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=2023525077&site=qq&menu=yes"></a>
        </li>
        <li class="totop"></li>
    </ul>
</section>

</body>
</html>
